
#include "bsp.h"

void pwm_output_test(void)
{
    pwm_tim_t tim;
    pwm_gpio_t gpio;
    pwm_param_t param;
    
    param.freq = 2000;
    param.duty_cycle = 5000;
    
    tim.enable = ENABLE;

    gpio.gpio_af   = GPIO_AF_TIMER1_CH_2_PB10;
    gpio.gpio_pin  = GPIO_PIN_10;
    gpio.gpio_port = GPIOB;
    tim.tim_ch = TIM_CH_2;
    tim.tim_n  = TIMER1;
    bsp_pwm_output(&gpio, &tim, &param);
    
    gpio.gpio_af   = GPIO_AF_TIMER0_CH_0_PA8;
    gpio.gpio_pin  = GPIO_PIN_8;
    gpio.gpio_port = GPIOA;
    tim.tim_ch = TIM_CH_0;
    tim.tim_n  = TIMER0;
    bsp_pwm_output(&gpio, &tim, &param);
    
    gpio.gpio_af   = GPIO_AF_TIMER0_CHN_1_PB0;
    gpio.gpio_pin  = GPIO_PIN_0;
    gpio.gpio_port = GPIOB;
    tim.tim_ch = TIM_CH_1;
    tim.tim_n  = TIMER0;
    bsp_pwm_output_n(&gpio, &tim, &param);
    
    
    
}

